package com.example.mapper;

import com.example.pojo.Emp;
import com.example.pojo.Plan;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface PlanMapper {
    Long count(String planName, int departmentID, LocalDate begin, LocalDate end);

    List<Plan> page(Integer start, Integer pageSize, String planName, int departmentID, LocalDate begin, LocalDate end);

    @Insert("insert into productionPlans (planName,startDate,endDate,managerID,departmentID,payid) values (#{planName},#{startDate},#{endDate},#{managerID},#{departmentID},#{payid})")
    void add(Plan plan);

    void delete(List<Integer> ids);

    void update(Plan plan);
@Select("select payid from productionPlans where planID=#{planId}")
    int select(int planId);
@Select("select * from productionPlans")
    List<Plan> getAll();

    void deletes(int[] id);
}
